import 'package:flutter/material.dart';

class MyApp7 extends StatelessWidget {
  const MyApp7({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          'image组件的使用',
          style: TextStyle(fontSize: 18, color: Colors.white),
        ),
        backgroundColor: Colors.red,
        centerTitle: true,
      ),
      body: Center(
          child: Container(
        width: 300,
        height: 400,
        color: Colors.indigo,
        //网络图片
        // child: Image.network(
        //   'https://yanxuan-item.nosdn.127.net/e529b6ab111ade9da9314867f98d360f.png',
        //   fit: BoxFit.contain,
        // ),
        //本地图片->需要在pubspec.yaml 文件中，配置静态资源加载路径
        child: Image.asset(
          'open_eyes.png',
        ),
      )),
    );
  }
}
